/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "empleado", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Empleado.findAll", query = "SELECT e FROM Empleado e"),
    @NamedQuery(name = "Empleado.findByCiEmp", query = "SELECT e FROM Empleado e WHERE e.ciEmp = :ciEmp"),
    @NamedQuery(name = "Empleado.findByNomEmp", query = "SELECT e FROM Empleado e WHERE e.nomEmp = :nomEmp"),
    @NamedQuery(name = "Empleado.findByApeEmp", query = "SELECT e FROM Empleado e WHERE e.apeEmp = :apeEmp"),
    @NamedQuery(name = "Empleado.findByTelEmp", query = "SELECT e FROM Empleado e WHERE e.telEmp = :telEmp"),
    @NamedQuery(name = "Empleado.findByCelEmp", query = "SELECT e FROM Empleado e WHERE e.celEmp = :celEmp"),
    @NamedQuery(name = "Empleado.findByDirEmp", query = "SELECT e FROM Empleado e WHERE e.dirEmp = :dirEmp")})
public class Empleado implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ci_emp", nullable = false)
    private Integer ciEmp;
    @Size(max = 20)
    @Column(name = "nom_emp", length = 20)
    private String nomEmp;
    @Size(max = 10)
    @Column(name = "ape_emp", length = 10)
    private String apeEmp;
    @Size(max = 10)
    @Column(name = "tel_emp", length = 10)
    private String telEmp;
    @Size(max = 10)
    @Column(name = "cel_emp", length = 10)
    private String celEmp;
    @Size(max = 10)
    @Column(name = "dir_emp", length = 10)
    private String dirEmp;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "empleado")
    private Collection<Contrato> contratoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ciEmp")
    private Collection<Arqueo> arqueoCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ciEmp")
    private Collection<AperCierre> aperCierreCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ciEmp")
    private Collection<Usuario> usuarioCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "empleado")
    private Collection<ReservaTurno> reservaTurnoCollection;
    @JoinColumn(name = "idciudad", referencedColumnName = "idciudad", nullable = false)
    @ManyToOne(optional = false)
    private Ciudad idciudad;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "ciEmp")
    private Collection<PedidoCab> pedidoCabCollection;

    public Empleado() {
    }

    public Empleado(Integer ciEmp) {
        this.ciEmp = ciEmp;
    }

    public Integer getCiEmp() {
        return ciEmp;
    }

    public void setCiEmp(Integer ciEmp) {
        this.ciEmp = ciEmp;
    }

    public String getNomEmp() {
        return nomEmp;
    }

    public void setNomEmp(String nomEmp) {
        this.nomEmp = nomEmp;
    }

    public String getApeEmp() {
        return apeEmp;
    }

    public void setApeEmp(String apeEmp) {
        this.apeEmp = apeEmp;
    }

    public String getTelEmp() {
        return telEmp;
    }

    public void setTelEmp(String telEmp) {
        this.telEmp = telEmp;
    }

    public String getCelEmp() {
        return celEmp;
    }

    public void setCelEmp(String celEmp) {
        this.celEmp = celEmp;
    }

    public String getDirEmp() {
        return dirEmp;
    }

    public void setDirEmp(String dirEmp) {
        this.dirEmp = dirEmp;
    }

    @XmlTransient
    public Collection<Contrato> getContratoCollection() {
        return contratoCollection;
    }

    public void setContratoCollection(Collection<Contrato> contratoCollection) {
        this.contratoCollection = contratoCollection;
    }

    @XmlTransient
    public Collection<Arqueo> getArqueoCollection() {
        return arqueoCollection;
    }

    public void setArqueoCollection(Collection<Arqueo> arqueoCollection) {
        this.arqueoCollection = arqueoCollection;
    }

    @XmlTransient
    public Collection<AperCierre> getAperCierreCollection() {
        return aperCierreCollection;
    }

    public void setAperCierreCollection(Collection<AperCierre> aperCierreCollection) {
        this.aperCierreCollection = aperCierreCollection;
    }

    @XmlTransient
    public Collection<Usuario> getUsuarioCollection() {
        return usuarioCollection;
    }

    public void setUsuarioCollection(Collection<Usuario> usuarioCollection) {
        this.usuarioCollection = usuarioCollection;
    }

    @XmlTransient
    public Collection<ReservaTurno> getReservaTurnoCollection() {
        return reservaTurnoCollection;
    }

    public void setReservaTurnoCollection(Collection<ReservaTurno> reservaTurnoCollection) {
        this.reservaTurnoCollection = reservaTurnoCollection;
    }

    public Ciudad getIdciudad() {
        return idciudad;
    }

    public void setIdciudad(Ciudad idciudad) {
        this.idciudad = idciudad;
    }

    @XmlTransient
    public Collection<PedidoCab> getPedidoCabCollection() {
        return pedidoCabCollection;
    }

    public void setPedidoCabCollection(Collection<PedidoCab> pedidoCabCollection) {
        this.pedidoCabCollection = pedidoCabCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (ciEmp != null ? ciEmp.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Empleado)) {
            return false;
        }
        Empleado other = (Empleado) object;
        if ((this.ciEmp == null && other.ciEmp != null) || (this.ciEmp != null && !this.ciEmp.equals(other.ciEmp))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.Empleado[ ciEmp=" + ciEmp + " ]";
    }
    
}
